package com.aaa.order.dao;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;
import java.util.Map;

/**
 * fileName:OrderOperateHistoryDao
 * description:
 * author:xjf
 * createTime:2020/1/8 8:19
 * version:1.0.0
 */
public interface OrderOperateHistoryDao {

    @Select({"<script>" +
            "select * from oms_order_operate_history" +
            "<where> order_id=#{orderId} </where>" +
            "</script>"})
    List<Map> getListByParam(Map map);

    @Insert("insert into oms_order_operate_history(order_id,shop_id,operate_man,create_time,order_status,note)" +
            "VALUES(#{orderId},#{shopId},#{operateMan},sysdate(),#{orderStatus},#{note})")
    int add(Map map);

    @Update("update oms_order_operate_history SET order_id= #{orderId}," +
            "shop_id=#{shopId}," +
            "operate_man=#{operateMan}," +
            "order_status=#{orderStatus}," +
            "note=#{note}" +
            "where id= #{Id}")
    int update(Map map);

    @Delete("delete from oms_order_operate_history where id=#{Id}")
    int delete(Map map);

}
